<!DOCTYPE html>
<!-- 登录模板为22,跳转的大数据模板为08 -->
<html>
	<head>
		<title>管理系统登录界面</title>

		<meta name="keywords" content="管理系统登录界面" />

		<meta name="description" content="最全的管理系统登录界面下载网站http://cn.inspinia.cn" />
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<script type="application/x-javascript">
			addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); }
		</script>
		<!-- 加入jQuery -->
		<script src="https://code.jquery.com/jquery-3.6.0.min.js" type="text/javascript"></script>
		<link href="css/style.css" rel="stylesheet" type="text/css" />
	</head>
	<body>
		<h1>Flate Signup And Login Form</h1>
		<div class="two-forms">
			<div class="wrap">
				<!-- 去除了signup -->
				<!-- <div class="signup">
					<h2>Signup<span>Form</span></h2>
					<div class="singup-info">
								<form>
									<input type="text" class="text" value="First Name" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'First Name';}" >
										<input type="text" class="text" value="Second Name" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Second Name';}" >
											<div class="users">
												<input type="text" class="text" value="User Name" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'User Name';}" >
												<input type="text" class="text" value="Email Address" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Email Address';}" >
												<input type="password" value="Password" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Password';}">
											</div>
								</form>
								<div class="p-container">
													<label class="checkbox"><input type="checkbox" name="checkbox" checked><i> </i>I Agree to the terms of use</label>
										</div>
										<input type="submit" onclick="myFunction()" value="signup" >
										<div class="clear"> </div>
										<p>Have an account with us?<a href="#">Login here</a></p>
										<div class="clear"> </div>
						</div>
				</div> -->
				<div class="login">
					<h3>Login<span>Form</span></h3>
					<div class="login-info">
						<input
							type="text"
							class="text"
							value="User Name"
							onfocus="this.value = '';"
							onblur="if (this.value == '') {this.value = 'User Name';}"
						/>
						<input
							type="password"
							value="Password"
							onfocus="this.value = '';"
							onblur="if (this.value == '') {this.value = 'Password';}"
						/>
						<div class="btns">
							<!-- 提交操作 -->
							<input type="submit" value="login" onclick="insertUser()" />
						</div>
						<p>
							<a href="#">Forgot your password?<span>Click here</span></a>
						</p>
					</div>
				</div>
				<div class="clear"></div>
			</div>
		</div>
		<div class="copy-right">
			<p>
				Template by
				<a
					href="javascript:if(confirm('http://w3layouts.com/  \n\n���ļ�δ�� Teleport Pro 
					���أ���Ϊ ��λ����ʼ��ַ�����õı߽���������·���С�  \n\n����
					Ҫ�ӷ�����������?'))window.location='http://w3layouts.com/'"
					target="_blank"
					>w3layouts</a
				>
			</p>
		</div>

		<script>
			function insertUser() {
				var user = {};
				user.userName = $(".text").val();
				user.password = $("[type=password]").val();
				//调用ajax函数，参数为ajax的配置属性对象
				$.ajax({
					url: "http://www.sfac.xyz/api/login",
					type: "post",
					contentType: "application/json",
					data: JSON.stringify(user),
					success: function (result) {
						if (result.status == 200) {
							alert(result.message);
							console.log(result.data);
							// 跳转到大数据模板
							window.location.href =
								"file:///D:/VSCode/sfac_template/%E6%A8%A1%E7%89%88_%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90/008/index.html";
						} else {
							alert(result.message);
						}
					},
					error: function (erro) {
						console.log(erro);
					},
				});
			}
		</script>
	</body>
</html>
